import { S } from '../../s';
import { IPSDEFormDetail } from './ipsdeform-detail';
import { IPSDEFormGroupBase } from './ipsdeform-group-base';
import { PSDEFormDetailImpl } from './psdeform-detail-impl';
import { IPSLayout } from '../layout/ipslayout';
import { IPSLayoutContainer } from '../layout/ipslayout-container';

export class PSDEFormBaseGroupPanelImpl
  extends PSDEFormDetailImpl
  implements IPSLayoutContainer, IPSDEFormGroupBase
{
  get captionItemName(): string {
    return this.M.captionItemName;
  }

  get itemIgnoreInput(): number {
    return this.M.itemIgnoreInput != null ? this.M.itemIgnoreInput : 0;
  }

  protected psdeformdetails: IPSDEFormDetail[];
  getPSDEFormDetails(): IPSDEFormDetail[] | null {
    return (
      this.psdeformdetails ||
      (this.psdeformdetails = this.fillChildListModel(
        this.M.getPSDEFormDetails,
        S._ab,
      ) as IPSDEFormDetail[])
    );
  }

  findPSDEFormDetail(objKey: any): IPSDEFormDetail | null {
    return this.getPSModel5(
      S._ab,
      this.getPSDEFormDetails(),
      objKey,
    ) as IPSDEFormDetail;
  }

  protected pslayout: IPSLayout;
  getPSLayout(): IPSLayout | null {
    return (
      this.pslayout ||
      (this.pslayout = this.fillObjectModel(
        S._298,
        this.M.getPSLayout,
        S._2e8,
      ) as IPSLayout)
    );
  }

  get subCaption(): string {
    return this.M.subCaption;
  }

  get titleBarCloseMode(): 0 | 1 | 2 {
    return this.M.titleBarCloseMode != null ? this.M.titleBarCloseMode : 0;
  }

  get enableAnchor(): boolean {
    return this.M.enableAnchor != null ? this.M.enableAnchor : false;
  }

  get hideEmptyItems(): boolean {
    return this.M.hideEmptyItems != null ? this.M.hideEmptyItems : false;
  }

  get infoGroupMode(): boolean {
    return this.M.infoGroupMode;
  }
  get cls(): string {
    return 'PSDEFormBaseGroupPanelImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._ad || cls == S._ae) return true;
    return super.instanceof(cls);
  }
}
